home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 4 / CU Amiga Magazine's Super CD-ROM 04 (1996)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1996-11].iso / magazine / psion / apps2 / holiday.lzx / holiday.opl next >
Text File  |  1996-02-29  |  2KB  |  112 lines

  1. PROC holiday:
  2. GLOBAL peop,cost,free,discnt,dispce,fltsup,under
  3. GLOBAL dis,full,supp,occ,tot,resort$(15),ans%,vers,titl$(20)
  4. GLOBAL broch$(15),pge
  5. LOCAL dys
  6. titl$="Holiday Pricer"
  7. vers=8.10
  8. start:
  9. go::
  10. CLS
  11. occ=0:dys=0:under=0
  12. dINIT titl$
  13. dEDIT resort$,"Hotel Name"
  14. dEDIT broch$,"Travel Company"
  15. dFLOAT pge,"Page No.",1,800
  16. DIALOG
  17. dINIT titl$
  18. dFLOAT peop,"No. full paying passengers",1,20
  19. dFLOAT cost,"Cost per person (œ)",1,9999
  20. dFLOAT fltsup,"Flight supplement (œ)",0,100
  21. DIALOG
  22. dINIT titl$
  23. dFLOAT occ,"Under occupancy perday (œ.p)",0,20
  24. dFLOAT dys,"No. of days",0,999
  25. dFLOAT free,"No. free passengers",0,6
  26. dFLOAT discnt,"No. discounted passengers",0,6
  27. dFLOAT dispce,"Discounted price (œ)",0,9999
  28. DIALOG
  29. IF occ>0
  30. under=occ*dys*peop
  31. ENDIF
  32. calc:
  33. disp:
  34. PAUSE -200
  35. GET
  36. prnt:
  37. dINIT titl$
  38. dCHOICE ans%,"Another","Yes,No"
  39. DIALOG
  40. IF ans%=1
  41. GOTO go
  42. ELSE stop
  43. ENDIF
  44. ENDP
  45.  
  46. PROC start:
  47. CLS
  48. gMOVE 40,10
  49. gLINEBY 160,0
  50. gLINEBY 0,-5
  51. gLINEBY -5,0
  52. gLINEBY 0,55
  53. gLINEBY -150,0
  54. gLINEBY 0,-55
  55. gLINEBY -5,0
  56. gLINEBY 0,5
  57. gAT 45,25:gFONT 2
  58. gPRINT "          Holiday   Pricer"
  59. gAT 45,35
  60. gPRINT "           by Keith Pirie"
  61. gAT 45,45
  62. gPRINT "             Version ",vers
  63. gAT 45,55
  64. gPRINT "                   @1994"
  65. PAUSE -100
  66. CLS
  67. ENDP
  68.  
  69. PROC prnt:
  70. LOCAL p%,pr%
  71. pr%=1
  72. dINIT titl$
  73. dCHOICE pr%,"Print Data","No,Yes"
  74. p%=DIALOG
  75. p%=pr%
  76. IF p%=2
  77. LOPEN "par:a"
  78. LPRINT "Travel Company",broch$,"  Page",pge
  79. LPRINT "Holiday at ";resort$
  80. LPRINT peop;" Paying full fare      œ",full
  81. LPRINT free;" Travelling free"
  82. LPRINT discnt; " Travelling discounted œ",dis
  83. LPRINT "Flight supplements      œ",supp
  84. LPRINT "Under Occupancy         œ",under
  85. LPRINT
  86. LPRINT "Total > œ";tot
  87. LCLOSE
  88. ENDIF
  89. ENDP
  90.  
  91. PROC disp:
  92. CLS
  93. PRINT "Travel Company",broch$,"  Page",pge
  94. PRINT "Holiday at ";resort$
  95. PRINT peop;" Paying full fare      œ",full
  96. PRINT free;" Travelling free"
  97. PRINT discnt; " Travelling discounted œ",dis
  98. PRINT "Flight supplements      œ",supp
  99. PRINT "Under Occupancy         œ",under
  100. PRINT
  101. PRINT "Total > œ";tot
  102. ENDP
  103.  
  104.  
  105. PROC calc:
  106. full=peop*cost
  107. dis=discnt*dispce
  108. supp=fltsup*(peop+discnt)
  109. tot=full+dis+supp+under
  110. ENDP
  111.  
  112.